<?php
namespace Application\Html\Controller;

class Document extends Base
{

    public function init()
    {
        $this->setDir('document');
        $this->setTemplate('download', 'download');
        $this->setTemplate('buy', 'buy');
        $this->setTemplate('agent', 'agent');
        $this->setTemplate('user', 'user');
    }

    private function getCommonData()
    {
        $data = [
            'domain' => 'https://api.lingchuangkeji.net',
            'version' => '1.0.2'
        ];
        return $data;
    }

    public function indexAction()
    {
        $data = $this->getCommonData();
        $data['page'] = 'index';
        $this->setFile($this->getTemplateIndex());
        $this->setData($data);
        $this->show();
    }

    public function downloadAction()
    {
        $data = $this->getCommonData();
        $data['page'] = 'download';
        $this->setFile($this->getTemplate('download'));
        $this->setData($data);
        $this->show();
    }

    public function buyAction()
    {
        $data = $this->getCommonData();
        $data['page'] = 'buy';
        $this->setFile($this->getTemplate('buy'));
        $this->setData($data);
        $this->show();
    }

    public function agentAction()
    {
        $data = $this->getCommonData();
        $data['page'] = 'agent';
        $this->setFile($this->getTemplate('agent'));
        $this->setData($data);
        $this->show();
    }

    public function userAction()
    {
        $data = $this->getCommonData();
        $data['page'] = 'user';
        $this->setFile($this->getTemplate('user'));
        $this->setData($data);
        $this->show();
    }

}